Feat: Add voice support check for UI elements#112
Conversation
This commit introduces a check for voice recognition support and updates the UI accordingly. - Added a new composable function `supportVoice()` in `MainActions.kt` to determine if the device supports speech recognition. - In `DetailScreen.kt` and `NoteApp.kt`, the `AddDetailBottomSheet2` and `MainBottomBar` composables now conditionally display voice input options based on the result of `supportVoice()`. - The `AddDetailBottomSheet2.kt` composable now accepts an `isVoiceSupport` parameter to control the visibility of the recording option.
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
/improve --pr_code_suggestions.commitable_code_suggestions=true |
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
This commit introduces an optimization in the `supportVoice` composable function and applies code formatting changes. - In `MainActions.kt`, the `LocalContext.current` is now fetched outside the `remember` block within `supportVoice()`. This prevents redundant lookups of the context on recomposition. - In `NoteApp.kt`, the code for navigating to the drawing screen after inserting a new drawing and the code for the voice note IconButton has been reformatted for better readability. No functional changes were made in `NoteApp.kt`.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #112 +/- ##
==========================================
+ Coverage 0.86% 0.88% +0.02%
==========================================
Files 158 156 -2
Lines 6840 6868 +28
Branches 537 540 +3
==========================================
+ Hits 59 61 +2
- Misses 6772 6794 +22
- Partials 9 13 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
PR Type
Enhancement
Description
Added voice support check.
Updated UI for voice input.
Improved UI consistency.
Enhanced user experience.
Changes walkthrough 📝
NoteApp.kt
UI Enhancement: Conditional Voice Input Renderingapp/src/main/java/com/mshdabiola/playnotepad/ui/NoteApp.kt
isVoiceSupportparameter toNoteBottomBar.isVoiceSupport.NoteAppcomposable to passisVoiceSupporttoNoteBottomBar.AddDetailBottomSheet2.kt
UI Enhancement: Conditional Voice Recording Optionfeature/detail/src/main/kotlin/com/mshdabiola/detail/AddDetailBottomSheet2.kt
isVoiceSupportparameter toAddBottomSheet2.DetailScreen.kt
UI Enhancement: Pass Voice Support to DetailScreenfeature/detail/src/main/kotlin/com/mshdabiola/detail/DetailScreen.kt
isVoiceSupportparameter toDetailRoute.MainActions.kt
Added Voice Support Check Functionmodules/ui/src/main/kotlin/com/mshdabiola/ui/MainActions.kt
supportVoice()function to check for voice recognition support.